package com.spzx.test1.t12;
/*
    并非全力
*/

import java.util.Random;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;

public class test1 {
    public static void main(String[] args) {
        ThreadPoolExecutor pool = new ThreadPoolExecutor(1, 5, 5,
                TimeUnit.SECONDS, new ArrayBlockingQueue<>(5));

        //面包
        Random rand = new Random();
        int bread = rand.nextInt(5) + 1; // 生成0-4的随机数，然后加1得到1-5


        new Thread(() -> {
            while (true) {
                System.out.println("做面包");
//                pool.execute();
            }

        }, "面包师傅");


    }


}
